<markdown-message>
  <script>
    export default {
      name: 'markdown-message',
      version: '0.0.1',
      setInnerHTML() {
        let shadowRoot = this.root.shadowRoot;
        if (!shadowRoot) {
          shadowRoot = this.root.attachShadow({
            mode: "open"
          });
        }
        shadowRoot.innerHTML = markdown.makeHtml(this.props.content);
        const style = document.createElement("style");
        style.innerHTML = `pre {
              white-space: pre-wrap;       /* css-3 */
              white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
              white-space: -pre-wrap;      /* Opera 4-6 */
              white-space: -o-pre-wrap;    /* Opera 7 */
              word-wrap: break-word;       /* Internet Explorer 5.5+ */
              background-color: #f8f8f899;
              border: 1px solid #dfdfdf99;
              margin: 10px 0;
              padding: 10px;
          }

          pre code {
              line-height: 1.25;
              background-color: transparent;
              border: 0;
              padding: 0;
          }`;
        shadowRoot.appendChild(style);
        //shadowRoot.childNodes.forEach(el => {
        //  if (el.nodeType === 1) {
        //    el = markdown.makeHtml(el);
        //  }
        //});
        this.root.innerHTML = shadowRoot;
      },
      onMounted() {
        this.setInnerHTML()
        console.log('markdown-message onMounted');
      },
      onUpdated() {
        this.setInnerHTML()
      }
    }
  </script>
</markdown-message>